package cn.njupt.unionfind;
//路径分割，没有路径压缩那么极端
public class Quick_Union_Rank_PathSeparate extends Quick_Union_Rank{

    public Quick_Union_Rank_PathSeparate(int capacity) {
        super(capacity);
    }

    @Override
    public int find(int child) {

        while(child!=parent[child]){
            int father=parent[child];
            parent[child]=parent[parent[child]];
            child=father;
        }
        return  parent[child];
    }
}
